/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sfms.view;

import javax.swing.JOptionPane;
import javax.swing.JPasswordField;

/**
 *
 * @author hy753
 */
public class Password{
    public static String getPassword(){
        JPasswordField pwd = new JPasswordField(10);
        int action = JOptionPane.showConfirmDialog(null, pwd,"Enter Password:",
        JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE); 
        
        if(action == JOptionPane.CANCEL_OPTION || action == JOptionPane.CLOSED_OPTION){
            return null;
        }  
        else{ 
            return new String(pwd.getPassword());
        }
    }
}
